package com.linkoog.devtools.code_generator.database.dao.db;

import com.linkoog.devtools.code_generator.database.domain.ColumnInfo;
import com.linkoog.devtools.code_generator.database.domain.ConnectionInfo;
import com.linkoog.devtools.code_generator.database.domain.DatabaseInfo;
import com.linkoog.devtools.code_generator.database.domain.TableInfo;
import com.linkoog.devtools.code_generator.database.dao.AbstractDatabaseDao;
import org.jetbrains.annotations.NotNull;

import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.List;

public class OracleDatabaseDao extends AbstractDatabaseDao {


    public OracleDatabaseDao(@NotNull ConnectionInfo connectionInfo) {
        super(connectionInfo);
    }

    @Override
    public boolean validConnection() {
        Connection conn = getConnection();
        try (Statement statement = conn.createStatement()){
            return statement.execute("select 1 from dual");
        } catch (SQLException e) {
            return false;
        } finally {
            closeConnection(conn);
        }
    }

    @Override
    public List<DatabaseInfo> getDatabaseInfoList() {
        return null;
    }

    @Override
    public List<String> getSchemaList(String database) {
        return null;
    }

    @Override
    public List<TableInfo> getTableInfoList(String database, String schema) {
        return null;
    }

    @Override
    public List<ColumnInfo> getColumnInfoList(String database, String schema, String table) {
        return null;
    }


}
